package com.xukehong.demo.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: xkh
 * @Date: 2019/12/9 17:08
 * @Version 1.0
 */
@Controller
@RequestMapping
@Api(tags = "登录")
@Slf4j
public class LoginController {
    /**
     * 默认登录地址
     */
    @ApiOperation("默认登录地址")
    @GetMapping("/")
    public String login() {
        log.info("进入登录");
        return "login";
    }

    @ApiOperation("登录失败返回")
    @GetMapping("/login")
    public String loginError() {
        return "login";
    }


    @ApiOperation("登录成功返回")
    @RequestMapping("/index")
    public String loginSuccess() {
        return "index";
    }
}
